package com.example.controller.configuration;

import com.example.bean.configuration.PingGuMoBan;
import com.example.bean.configuration.vo.LaoNianRenNengLiPingGuVo;
import com.example.bean.configuration.LaoNianRenNengLiPingGu;
import com.example.service.configuration.LaoNianRenNengLiPingGuService;
import com.example.utils.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/laonianrennenglipinggu")
public class LaoNianRenNengLiPingGuController {
    @Autowired
    LaoNianRenNengLiPingGuService service;

    @PostMapping("/page")
    public PageInfo<LaoNianRenNengLiPingGu> page(@RequestBody LaoNianRenNengLiPingGuVo vo){
        return service.getpage(vo);
    }

    @GetMapping("/xiala")
    public Result xiala(){
        List<PingGuMoBan> list = service.xiala();
        Result r = new Result();
        r.setData(list);
        return r;
    }

//    @PostMapping("/biao/{noid}")
//    public Result biao(@PathVariable String noid){
//        LaoNianRenNengLiPingGu lnr  = service.getid(noid);
//        Result r = new Result();
//        r.setData(lnr);
//        return r;
//    }
}
